from django.contrib import admin
from .models import Course, Category


# Register your models here.
@admin.register(Course)
class CourseAdmin(admin.ModelAdmin):
    filter_horizontal = ['userBuyer', 'userShoppingcart']
    list_display = ['id', 'courseName', 'price', 'status', 'createDatetime', 'category']
    list_filter = ['price', 'status', 'createDatetime', 'category']
    search_fields = ['courseName', 'summary']

@admin.register(Category)
class Category(admin.ModelAdmin):
    list_display = ['id', 'name']
    search_fields = ['name']
